home *** CD-ROM | disk | FTP | other *** search
/ La Traviata / La Traviata.iso / viewer / giflib12.zip / DOS2UNIX < prev    next >
Text File  |  1991-05-05  |  671b  |  37 lines

  1. #!/bin/csh -f
  2. #
  3. # Gershon Elber, Feb 90.
  4. #
  5.  
  6. set upcase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  7. set locase = "abcdefghijklmnopqrstuvwxyz"
  8.  
  9. echo
  10. echo +++++ Rename directories:
  11. echo
  12. foreach d (`find . -type d -print`)
  13.     set new_d = `echo $d | tr $upcase $locase`
  14.  
  15.     if ( "$d" != "$new_d" ) then
  16.         echo $d to $new_d
  17.     mv $d $new_d
  18.     endif
  19. end
  20.  
  21. echo
  22. echo +++++ Rename files, strip CR/LF to LF and remove DOS ^Z:
  23. echo
  24. foreach f (`find . -type f -print`)
  25.     set new_f = `echo $f | tr $upcase $locase`
  26.     echo $f to $new_f
  27.  
  28.     tr -d "\015\032" < $f > $new_f.tmp
  29.     rm -r $f
  30.     mv $new_f.tmp $new_f
  31. end
  32.  
  33. #
  34. # Do small fixes manually.
  35. #
  36. (chmod +x dos2unix make-unx test-unx)
  37.